home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagg_m.zip / HARDWARE.SWG / 0006_FLOPSIZE.PAS.pas < prev    next >
Pascal/Delphi Source File  |  1993-05-28  |  1KB  |  41 lines

  1. {
  2. >Does anybody know how to determine the size of a disk drive.  I mean
  3. >whether it is a 360 K drive or 720 K, 1.4 M or 1.2 M drive.  I'm
  4. >working on a Program which has the ability to Format diskettes and
  5. >I want it to be able to come up With the size of a disk drive as a
  6. >default.  I have looked at the equipment flag in the BIOS and the
  7. >only thing I can get out of that is the Type of a disk drive not the
  8. >size.
  9. }
  10. Function VarCMOS(i : Byte) : Byte ;
  11. begin
  12.      port[$70]:=i;
  13.      VarCMOS:=port[$71]
  14. end;
  15.  
  16. Var  b    : Byte ;
  17.  
  18. begin
  19.      b:=VarCMOS($10);
  20.      if b and $f0<>0 then
  21.      begin
  22.           Write('Drive A: = ');
  23.           Case (b and $f0) shr 4 of
  24.                1 : Write('5" 360 Ko');
  25.                2 : Write('5" 1,2 Mo');
  26.                3 : Write('3" 720 Ko');
  27.                4 : Write('3" 1,44 Mo')
  28.           end;
  29.      end;
  30.      if b and $f<>0 then
  31.      begin
  32.           Write(', B: = ');
  33.           Case b and $f of
  34.                1 : Writeln('5" 360 Ko');
  35.                2 : Writeln('5" 1,2 Mo');
  36.                3 : Writeln('3" 720 Ko');
  37.                4 : Writeln('3" 1,44 Mo')
  38.           end;
  39.      end else WriteLn ;
  40. end.
  41.